home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / BBS / IEMSI002.ZIP / MAX.MH < prev    next >
Encoding:
Text File  |  1995-11-26  |  26.4 KB  |  735 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File: max.mh
  4. //
  5. // Desc: MEX include file for Maximus.  This must be included by all MEX
  6. //       programs that interface with Maximus routines.
  7. //
  8. // Copyright 1990, 1994 by Lanius Corporation.  All rights reserved.
  9. //
  10. // $Id: max.mh 1.17 1995/07/15 14:50:23 sjd Exp $
  11. //
  12. //////////////////////////////////////////////////////////////////////////////
  13.  
  14. // Boolean type definitions
  15.  
  16. #define TRUE   1
  17. #define FALSE  0
  18.  
  19. // Common
  20.  
  21. #define True              1
  22. #define False             0
  23.  
  24. // Query types for class_info()
  25.  
  26. #define CIT_NUMCLASSES    -1
  27. #define CIT_DAY_TIME      0
  28. #define CIT_CALL_TIME     1
  29. #define CIT_DL_LIMIT      2
  30. #define CIT_RATIO         3
  31. #define CIT_MIN_BAUD      4
  32. #define CIT_MIN_XFER_BAUD 5
  33. #define CIT_MAX_CALLS     6
  34. #define CIT_FREE_RATIO    7
  35. #define CIT_UPLOAD_REWARD 8
  36. #define CIT_ACCESSFLAGS   9
  37. #define CIT_MAILFLAGS     10
  38. #define CIT_USERFLAGS     11
  39. #define CIT_LEVEL         12
  40. #define CIT_CLASSKEY      13
  41.  
  42. #define CIT_BYINDEX       32768     // OR with type to search by class index
  43.  
  44. // Types for input_str():
  45.  
  46. // One of the following three options must be used:
  47. #define INPUT_LB_LINE     0x0001 // Input a line, allowing stacked input
  48. #define INPUT_NLB_LINE    0x0002 // Input a line, not allowing stacked input
  49. #define INPUT_WORD        0x0004 // Input a word, allowing stacked input
  50.  
  51. // Any of the following options can also be specified:
  52. #define INPUT_ECHO        0x0008 // The character in 'ch' should be echoed
  53.                                  // back to user, instead of the character
  54.                                  // actually typed.
  55.  
  56. #define INPUT_ALREADYCH   0x0010 // The character in 'ch' was already typed
  57.                                  // by the user and should be inserted at
  58.                                  // the beginning of the string.
  59. #define INPUT_SCAN        0x0020 // Allow scan codes to be placed in string
  60. #define INPUT_NOCTRLC     0x0040 // Don't allow user to ^C to redisplay prompt
  61. #define INPUT_RSVD1       0x0080 // Reserved
  62. #define INPUT_NOLF        0x0100 // Don't send an LF at end of input function
  63. #define INPUT_RSVD2       0x0200 // Reserved
  64. #define INPUT_WORDWRAP    0x0400 // Permit word-wrapping
  65. #define INPUT_NOCLEOL     0x0800 // Never issue CLEOL codes
  66. #define INPUT_DEFAULT     0x1000 // Pretend that the current contents of
  67.                                  // string 's' were already entered by
  68.                                  // the user.
  69. #define INPUT_NOECHO      0x2000 // Disable input echo
  70.  
  71. // Types for input_ch() and input_list():
  72.  
  73. #define CINPUT_DISPLAY    0x0001 // Always display the character entered
  74.                                  // by the user, even if in hotkey mode.
  75. #define CINPUT_RTNHELP    0x0001 // Valid only for GetListAnswer()
  76.                                  // Returns to caller if 'help' key after
  77.                                  // displaying the help file
  78. #define CINPUT_ACCEPTABLE 0x0002 // 'options' specifies a string of acceptable
  79.                                  // characters.  The char entered by the user
  80.                                  // must be contained in that string.
  81. #define CINPUT_PROMPT     0x0004 // Display the prompt in 'options' before
  82.                                  // trying to get the character.
  83. #define CINPUT_RESERVED1  0x0008 // Reserved
  84. #define CINPUT_SCAN       0x0010 // Return scan codes, if applicable
  85. #define CINPUT_NOXLT      0x0020 // Don't translate special characters,
  86.                                  // such as \r and \n, into their ASCII
  87.                                  // equivilents.  (For example, <enter>
  88.                                  // will be returned as '\r' with this
  89.                                  // option, instead of '|'.)
  90. #define CINPUT_NOCTRLC    0x0040 // Don't allow user to ^C to dump output
  91.                                  // and redisplay prompt.
  92. #define CINPUT_P_CTRLC    0x0080 // Only display prompt in 'options' if
  93.                                  // user presses ^C
  94. #define CINPUT_NOLF       0x0100 // Don't display LF at end of input function
  95. #define CINPUT_FULLPROMPT 0x0200 // input_list only:  do not add
  96.                                  // a bracketed list of acceptable chars
  97.                                  // to the end of the prompt string.
  98.                                  // (eg. "[a,b,c,d,?]")
  99. #define CINPUT_ALLANSWERS 0x0400 // Allow the user to exit by pressing <cr>
  100.                                  // only
  101. #define CINPUT_DUMP       0x0800 // Flush output buffer when we get a character
  102. #define CINPUT_RESERVED2  0x1000 // Reserved
  103. #define CINPUT_NOUPPER    0x2000 // Don't convert input char to uppercase
  104. #define CINPUT_AUTOP      0x4000 // Display prompt even if user has hotkeys
  105.                                  // enabled
  106. #define CINPUT_ANY        0x8000 // input_list only:  any response allowed,
  107.                                  // even if not contained in 'list'
  108.  
  109. // Constants for class_info(CIT_MAILFLAGS)
  110.  
  111. #define CFLAGM_PVT      0x01000000              /* Show private messages */
  112. #define CFLAGM_EDITOR   0x02000000             /* External editor access */
  113. #define CFLAGM_LEDITOR  0x04000000       /* Local external editor access */
  114. #define CFLAGM_NETFREE  0x08000000                  /* Netmail is 'free' */
  115. #define CFLAGM_ATTRANY  0x10000000  /* Allow 'sysop' attribute overrides */
  116. #define CFLAGM_RDONLYOK 0x40000000  /* Allow write priv in readonly area */
  117. #define CFLAGM_NOREALNM 0x80000000       /* Don't add ^aREALNAME to msgs */
  118.  
  119. // Constants for class_info(CIT_ACCESSFLAGS)
  120.  
  121. #define CFLAGA_ULBBSOK  0x00000001         /* Uploading .?bs files is ok */
  122. #define CFLAGA_FLIST    0x00000002  /* Allow file dloads not in filelist */
  123. #define CFLAGA_FHIDDEN  0x00000004        /* See/download 'hidden' files */
  124. #define CFLAGA_UHIDDEN  0x00000008  /* Allow 'not in userlist' user view */
  125. #define CFLAGA_HIDDEN   0x00000010           /* Always hide in user list */
  126. #define CFLAGA_HANGUP   0x00000020                 /* Hangup immediately */
  127. #define CFLAGA_NOLIMIT  0x00000040           /* Don't check dload limits */
  128. #define CFLAGA_NOTIME   0x00000080            /* Don't check time limits */
  129.  
  130.  
  131.  
  132. // Various constants for the user record:
  133.  
  134. // usr.help
  135. #define HELP_NOVICE     6
  136. #define HELP_REGULAR    4
  137. #define HELP_EXPERT     2
  138.  
  139. // usr.video
  140. #define VIDEO_TTY       0
  141. #define VIDEO_ANSI      1
  142. #define VIDEO_AVATAR    2
  143.  
  144. // usr.sex
  145. #define SEX_UNKNOWN     0
  146. #define SEX_MALE        1
  147. #define SEX_FEMALE      2
  148.  
  149. // usr.def_proto
  150. //
  151. // Positive numbers indicate external protocols.
  152.  
  153. #define PROTOCOL_NONE        (char)(-1)
  154. #define PROTOCOL_XMODEM      (char)(-2)
  155. #define PROTOCOL_YMODEM      (char)(-3)
  156. #define PROTOCOL_XMODEM1K    (char)(-4)
  157. #define PROTOCOL_SEALINK     (char)(-5)
  158. #define PROTOCOL_ZMODEM      (char)(-6)
  159. #define PROTOCOL_YMODEMG     (char)(-7)
  160.  
  161. // Constants for tag_queue_file()
  162.  
  163. #define FFLAG_NOTIME    0x0004
  164. #define FFLAG_NOBYTES   0x0008
  165. #define FFLAG_STAGE     0x0400
  166. #define FFLAG_SLOW      0x0800
  167.  
  168. // Constants for open()
  169.  
  170. #define IOPEN_CREATE    0x01
  171. #define IOPEN_READ      0x02
  172. #define IOPEN_WRITE     0x04
  173. #define IOPEN_RW        0x06
  174. #define IOPEN_APPEND    0x08
  175. #define IOPEN_BINARY    0x80
  176.  
  177. // Constants for seek().where
  178.  
  179. #define SEEK_SET        0
  180. #define SEEK_CUR        1
  181. #define SEEK_END        2
  182.  
  183. // Constants for shell()
  184.  
  185. #define IOUTSIDE_RUN      0x01
  186. #define IOUTSIDE_DOS      0x02
  187. #define IOUTSIDE_REREAD   0x04
  188.  
  189. // Strings to be included as part of print() output to change screen attributes
  190.  
  191. #define COL_BLACK               "\x16\x01\x00"
  192. #define COL_BLUE                "\x16\x01\x01"
  193. #define COL_GREEN               "\x16\x01\x02"
  194. #define COL_CYAN                "\x16\x01\x03"
  195. #define COL_RED                 "\x16\x01\x04"
  196. #define COL_MAGENTA             "\x16\x01\x05"
  197. #define COL_BROWN               "\x16\x01\x06"
  198. #define COL_GRAY                "\x16\x01\x07"
  199. #define COL_DKGRAY              "\x16\x01\x08"
  200. #define COL_LBLUE               "\x16\x01\x09"
  201. #define COL_LGREEN              "\x16\x01\x0a"
  202. #define COL_LCYAN               "\x16\x01\x0b"
  203. #define COL_LRED                "\x16\x01\x0c"
  204. #define COL_LMAGENTA            "\x16\x01\x0d"
  205. #define COL_YELLOW              "\x16\x01\x0e"
  206. #define COL_WHITE               "\x16\x01\x0f"
  207. #define COL_YELLOWONBLUE        "\x16\x01\x1e"
  208. #define COL_BLACKONGREEN        "\x16\x01\x20"
  209. #define COL_REDONGREEN          "\x16\x01\x2c"
  210. #define COL_WHITEONGREEN        "\x16\x01\x2f"
  211.  
  212. #define AVATAR_BLINK            "\x16\x02"
  213. #define AVATAR_UP               "\x16\x03"
  214. #define AVATAR_DOWN             "\x16\x04"
  215. #define AVATAR_LEFT             "\x16\x05"
  216. #define AVATAR_RIGHT            "\x16\x06"
  217. #define AVATAR_CLEOL            "\x16\x07"
  218. #define AVATAR_GOTO             "\x16\x08"
  219. #define AVATAR_CLS              "\x0c"
  220. #define AVATAR_RPTCHAR          "\x19"
  221. #define AVATAR_RPTSEQ           "\x17\x19"
  222.  
  223. struct _date                    // Date structure
  224. {
  225.   char: day;                    // Day of month.   1 = first of month
  226.   char: month;                  // Month of year.  1 = January
  227.   char: year;                   // Year - 1980.    0 = 1980
  228. };
  229.  
  230. struct _time                    // Time structure
  231. {
  232.   char: hh;                     // Hour
  233.   char: mm;                     // Minute
  234.   char: ss;                     // Second
  235. };
  236.  
  237.  
  238. struct _stamp                   // Date and time structure
  239. {
  240.   struct _date: date;
  241.   struct _time: time;
  242. };
  243.  
  244.  
  245. struct _cstat                   // Chat status of a particular user
  246. {
  247.     int: task_num;              // User's node number.
  248.     int: avail;                 // Available for chat?
  249.     string: username;           // User's name
  250.     string: status;             // User's status
  251. };
  252.  
  253. struct _sys                     // System information
  254. {
  255.    int: current_row;            // Cursor's row position (1=top)
  256.    int: current_col;            // Cursor's column position (1=left)
  257.    int: more_lines;             // # of lines displayed since last More[Y,n]
  258. };
  259.  
  260. struct _msg                     // Information about current message
  261. {
  262.   long: current;                // Current message number
  263.   long: high;                   // Highest message number
  264.   long: num;                    // Number of messages in area
  265.   int:  direction;              // Reading direction (1==next, 0==prior)
  266. };
  267.  
  268. // For marea.attribs:
  269.  
  270. #define MA_PVT      0x0001      // Private msgs allowed
  271. #define MA_PUB      0x0002      // Public msgs allowed
  272. #define MA_HIBIT    0x0004      // High bit msgs allowed
  273.  
  274. #define MA_NET      0x0008      // Netmail area
  275. #define MA_ECHO     0x0010      // Echomail area
  276. #define MA_CONF     0x0020      // Conference area
  277.  
  278. #define MA_ANON     0x0040      // Anonymous messages are OK
  279. #define MA_NORNK    0x0080      // Don't use the REALNAME kludge for this area
  280. #define MA_REAL     0x0100      // Force  use of       real name for this area
  281. #define MA_ALIAS    0x0200      // Force  use of alias      name for this area
  282. #define MA_AUDIT    0x0400      // Use auditing (msg tracking) controls in area
  283. #define MA_READONLY 0x0800      // Area is read-only
  284. #define MA_HIDDN    0x1000      // Area does not display on normal area list
  285. #define MA_ATTACH   0x2000      // Area allows local file attaches
  286.  
  287. // For marea.type:
  288.  
  289. #define MSGTYPE_SDM      1      // Area is *.MSG-type
  290. #define MSGTYPE_SQUISH   2      // Area is Squish-type
  291.  
  292. struct _marea                   // Information about current msg area
  293. {
  294.   string: name;                 // Area name
  295.   string: descript;             // Area description
  296.   string: path;                 // Area path
  297.   string: tag;                  // Area echo tag (if any)
  298.   string: attachpath;           // Path override for file attaches
  299.   string: barricade;            // Barricade file
  300.   int:    division;             // Non-zero means this is a file division (1=begin,2=end)
  301.   int:    type;                 // Message base type
  302.   int:    attribs;              // Area attributes
  303. };
  304.  
  305. #define FA_SLOW     0x0001      // Slow-access medium: skip existence checks
  306. #define FA_STAGED   0x0002      // Used staged transfer area for downloads
  307. #define FA_NONEW    0x0004      // Permanent storage - skip for new file checks
  308. #define FA_HIDDN    0x0008      // Area does not display on normal area list
  309. #define FA_DIVBEGIN 0x4000      // A file area division, not a real area
  310. #define FA_DIVEND   0x8000      // End of file area division
  311. #define FA_AUTODATE 0x0010      // Auto-date override
  312. #define FA_MANDATE  0x0020      // Manual date override
  313. #define FA_MANSIZE  0x0040      // Manual size override
  314. #define FA_FREETIME 0x0100      // Free download time for all files
  315. #define FA_FREESIZE 0x0200      // Free download bytes for all files
  316.  
  317. struct _farea                   // Information about current file area
  318. {
  319.   string: name;                 // Area name
  320.   string: descript;             // Area description
  321.   string: downpath;             // Download path
  322.   string: uppath;               // Upload path
  323.   string: filesbbs;             // Path to files list
  324.   string: barricade;            // Path to barricade file
  325.   int:    division;             // Non-zero means this is a file division (1=begin,2=end)
  326.   int:    attribs;              // Area attributes
  327. };
  328.  
  329. struct _usr                     // Information about current user
  330. {
  331.   string: name;                 // Caller's name
  332.   string: city;                 // Callers city and state/province
  333.   string: alias;                // User's alias
  334.   string: phone;                // User's phone number
  335.   unsigned int: lastread_ptr;   // Offset in LASTREAD.BBS/areaname.SQL
  336. //int:    time_remain;          // Time left for current call
  337.   string: pwd;                  // User's password
  338.   unsigned int:    times;       // Number of previous calls to system
  339.   char:   help;                 // Help level.  Novice=6, regular=4,
  340.                                 // expert=2, hotflash=32.
  341.   char:   video;                // Video mode.  0=tty, 1=ansi, 2=avatar
  342.   char:   nulls;                // Number of NULs (delays) after <cr>
  343.  
  344.   // Bits 1:
  345.  
  346.   char:   hotkeys;              // 1 = Hotkeys enabled
  347.   char:   notavail;             // 1 = Not available for chat
  348.   char:   fsr;                  // 1 = Full-screen reader is enabled
  349.   char:   nerd;                 // 1 = User is a nerd (cannot yell)
  350.   char:   noulist;              // 1 = User does not show in userlist
  351.   char:   tabs;                 // 1 = User can handle tab characters
  352.   char:   encrypted;            // 1 = User's password is encrypted
  353.   char:   rip;                  // 1 = User has RIP graphics turned on
  354.  
  355.   // Bits 2:
  356.  
  357.   char:   badlogon;             // 1 = Last logon attempt was bad
  358.   char:   ibmchars;             // 1 = User can handle IBM characters
  359.   char:   bored;                // 1 = BORED.  0 = MaxEd
  360.   char:   more;                 // 1 = More prompt enabled
  361.   char:   configured;           // 1 = City/pwd fields have been filled
  362.   char:   cls;                  // 1 = User can handle clearscreen
  363.  
  364.   unsigned int: priv;           // User's priv level.
  365.  
  366.   string: dataphone;            // User's data phone number
  367.   unsigned int: time;           // Length of time user has been on-line
  368.                                 // today.
  369.  
  370.   // Delflag
  371.  
  372.   char:   deleted;              // This user has been deleted.
  373.   char:   permanent;            // This user is permanent.
  374.  
  375. //long:   baud;
  376.   long:   msgs_posted;          // Number of messages posted
  377.   long:   msgs_read;            // Number of messages read
  378.  
  379.   char:   width;                // Width of caller's screen
  380.   char:   len;                  // Height of caller's screen
  381.  
  382.   unsigned int: credit;         // Netmail credit, in cents
  383.   unsigned int: debit;          // Netmail debit, in cents
  384.  
  385.   // Expiration controls
  386.  
  387.   unsigned int: xp_priv;        // Demote user to this priv when
  388.                                 // subscription expires.  (Same encoding
  389.                                 // as usr.priv)
  390.  
  391.   struct _stamp: xp_date;       // If it is past this date, the user has
  392.                                 // expired.
  393.  
  394.   unsigned long: xp_mins;       // The user has this many minutes left
  395.                                 // before expiring.
  396.  
  397.   // XPflag
  398.  
  399.   char:   expdate;              // 1 = Expire based on date in xp_date
  400.   char:   expmins;              // 1 = Expire based on time in xp_mins
  401.   char:   expdemote;            // 1 = When expired, demote to xp_priv
  402.   char:   expaxe;               // 1 = When expired, hang up
  403.  
  404.   char:   sex;                  // User's sex.  See SEX_xxx definitions
  405.  
  406.   struct _stamp: ludate;        // Date of user's last call
  407.  
  408.   string: xkeys;                // User's keys, as a string
  409.  
  410.   char:   lang;                 // User's current language. 0=first lang,
  411.                                 // 1=second lang, etc.
  412.  
  413.   char:   def_proto;            // User's default protocol.  See the
  414.                                 // PROTOCOL_xxx definitions above.
  415.                                 // Positive numbers indicate external
  416.                                 // protocols.
  417.  
  418.   unsigned long: up;            // Kilobytes uploaded, for all calls
  419.   unsigned long: down;          // Kilobytes downloaded, for all calls
  420.   unsigned long: downtoday;     // Kilobytes downloaded today
  421.  
  422.   string: msg;                  // Current message area
  423.   string: files;                // Last message area
  424.  
  425.   char:   compress;             // Default compression program
  426.   string: dob;                  // Caller's date of birth,
  427.                                 // stored in format yy.mm.dd
  428.                                 // eg. 74.03.24
  429.  
  430.   struct _stamp: date_1stcall;  // Date of user's first call
  431.   struct _stamp: date_pwd_chg;  // Date of user's last pwd change
  432.  
  433.   unsigned long: nup;           // Number of files uploaded
  434.   unsigned long: ndown;         // Number of files downloaded (total)
  435.   unsigned long: ndowntoday;    // Number of files downloaded (today)
  436.  
  437.   unsigned int: time_added;     // Time credits for today
  438.  
  439.   unsigned long: point_credit;  // Total number of point credits
  440.   unsigned long: point_debit;   // Total number of point debits
  441.  
  442.   struct _stamp: date_newfile;  // Date of last new-files search
  443.  
  444.   unsigned int: call;           // Number of previous calls today
  445.  
  446. };
  447.  
  448.  
  449. // Session data exported by Max:
  450.  
  451. struct _instancedata
  452. {
  453.   int:  instant_video;            // Status of "instant video"
  454.   unsigned int: task_num;         // Our task number
  455.   int:  local;                    // Is the user a local caller?
  456.   int:  port;                     // COM port number (OS/2: com handle)
  457.   unsigned long: speed;           // User's baud rate
  458.   int:  alias_system;             // Is this an alias system?
  459.   int:  ask_name;                 // Ask for user's real name?
  460.   int:  use_umsgid;               // Uses umsgid's rather than msg numbers
  461. };
  462.  
  463.  
  464. // Used with filefindfirst()
  465. #define FA_NORMAL   0x00
  466. #define FA_READONLY 0x01
  467. #define FA_HIDDEN   0x02
  468. #define FA_SYSTEM   0x04
  469. #define FA_VOLUME   0x08
  470. #define FA_SUBDIR   0x10
  471. #define FA_ARCHIVE  0x20
  472.  
  473. // Used by set_output()
  474. #define DISABLE_NONE    0
  475. #define DISABLE_LOCAL   1
  476. #define DISABLE_REMOTE  2
  477. #define DISABLE_BOTH    3
  478.  
  479. struct _ffind
  480. {
  481.     long:           finddata;
  482.     string:         filename;
  483.     unsigned long:  filesize;
  484.     struct _stamp:  filedate;
  485.     unsigned int:   fileattr;
  486. };
  487.  
  488. #define CALL_LOGON      0x8000       // Caller was logged on!
  489. #define CALL_CARRIER    0x0001       // Caller lost carrier
  490. #define CALL_EJECTED    0x0002       // Caller was ejected by sysop or priv
  491. #define CALL_PAGED_AH   0x0004       // Caller paged after hours
  492. #define CALL_DLEXCEED   0x0008       // Caller attempted to exceed d/l
  493. #define CALL_EXPIRED    0x0010       // Caller's subscription expired
  494. #define CALL_TIMELIMIT  0x0020       // Caller exceeded time limit
  495. #define CALL_NERD       0x0040       // Caller was nerd'ed
  496. #define CALL_BARRPWD    0x0080       // Barricade password failure
  497.  
  498. struct _callinfo
  499. {
  500.   string: name;
  501.   string: city;
  502.   struct _stamp: login;
  503.   struct _stamp: logoff;
  504.   int: task;
  505.   unsigned int: flags;
  506.   unsigned int: logon_priv;
  507.   string: logon_xkeys;
  508.   unsigned int: logoff_priv;
  509.   string: logoff_xkeys;
  510.   unsigned int: filesup;
  511.   unsigned int: filesdn;
  512.   unsigned int: kbup;
  513.   unsigned int: kbdn;
  514.   unsigned int: calls;
  515.   unsigned int: read;
  516.   unsigned int: posted;
  517.   unsigned int: paged;
  518.   int: added;
  519. };
  520.  
  521.  
  522. // GLOBAL DATA
  523.  
  524. string: input;                  // Current stacked input string
  525. struct _instancedata: id;       // Information about current session
  526. struct _marea: marea;           // Message area information
  527. struct _farea: farea;           // File area information
  528. struct _msg: msg;               // Current message information
  529. struct _usr: usr;               // User record
  530. struct _sys: sys;               // System information
  531.  
  532.  
  533. // Static data functions
  534.  
  535. int create_static_data(string: key, long: size);
  536. int get_static_data(string: key, ref void: data);
  537. int set_static_data(string: key, ref void: data);
  538. int destroy_static_data(string: key);
  539.  
  540. // Static string functions
  541.  
  542. int create_static_string(string: key);
  543. int get_static_string(string: key, ref string: data);
  544. int set_static_string(string: key, string: data);
  545. int destroy_static_string(string: key);
  546.  
  547. // Miscellaneous functions:
  548.  
  549. int vidsync();
  550. int shell(int: method, string: cmd);
  551. void sleep(int: duration);
  552. void log(string: s);
  553. long class_info(int: priv, int: CIT);
  554. int privok(string: privstr);
  555. string class_abbrev(int: priv);
  556. string class_name(int: priv);
  557. string class_loginfile(int: priv);
  558. unsigned int class_to_priv(string: s);
  559. int set_output(int: where);
  560. unsigned int term_length();
  561. unsigned int term_width();
  562. unsigned int screen_length();
  563. unsigned int screen_width();
  564.  
  565. // Time-related functions
  566.  
  567. unsigned long time();
  568. unsigned long timeon();
  569. unsigned long timeleft();
  570. long timeadjust(long: delta);
  571. long timeadjustsoft(long: delta);
  572. void timestamp(ref struct _stamp: stamp);
  573. string stamp_string(ref struct _stamp: stamp);
  574. unsigned long stamp_to_long(ref struct _stamp: st);
  575. void long_to_stamp(long: time, ref struct _stamp: st);
  576.  
  577.  
  578. // Miscellaneous Maximus-related commands
  579.  
  580. string protocol_num_to_name(char: pnum);
  581. string compressor_num_to_name(char: cnum);
  582. string language_num_to_name(char: lnum);
  583. int chat_querystatus(ref struct _cstat: cstat);
  584. string prm_string(int: stringnum);
  585.  
  586. // Functions for activating menu commands and displaying MECCA files.
  587.  
  588. void menu_cmd(int: cmdnum, string: args);
  589. int display_file(string: filename, ref char: nonstop);
  590.  
  591. // File areas:  download-related functions
  592.  
  593. int tag_queue_file(string: filename, int: flags);
  594. int tag_dequeue_file(int: posn);
  595. int tag_queue_size();
  596. int tag_get_name(int: posn, ref int: flags, ref string: filename);
  597.  
  598.  
  599. // Input functions
  600.  
  601. char getch();
  602. char kbhit();
  603. char localkey();
  604. int input_str(ref string: s, int: type, char: ch, int: max, string: prompt);
  605. int input_ch(int: type, string: options);
  606. int input_list(string: list, int: type, string: help_file,
  607.                string: invalid_response, string: prompt);
  608.  
  609.  
  610. // "More [Y,n]"-related commands
  611.  
  612. void reset_more(ref char: nonstop);
  613. int do_more(ref char: nonstop, string: colour);
  614.  
  615. // String functions
  616.  
  617. unsigned int strlen(string: s);
  618. int strtoi(string: s);
  619. long strtol(string: s);
  620. string itostr(int: i);
  621. string ltostr(long: l);
  622. string uitostr(unsigned int: ui);
  623. string ultostr(unsigned long: ul);
  624. int strfind(string: str, string: substring);
  625. int stridx(string: str, int: startpos, int: ch);
  626. int strridx(string: str, int: startpos, int: ch);
  627. string strpad(string: str, int: length, char: pad);
  628. string strpadleft(string: str, int: length, char: pad);
  629. string substr(string: s, int: pos, int: length);
  630. string strtok(string: src, string: toks, ref int: pos);
  631. string strupper(string: s);
  632. string strlower(string: s);
  633. string strtrim(string: s, string: x);
  634.  
  635. // File I/O functions:
  636.  
  637. int  open    (string: name, int: mode);
  638. int  read    (int: fd, ref string: s, int: len);
  639. int  readln  (int: fd, ref string: s);
  640. int  write   (int: fd, ref string: s, int: len);
  641. int  writeln (int: fd, string: s);
  642. long tell    (int: fd);
  643. long seek    (int: fd, long: pos, int: where);
  644. int  close   (int: fd);
  645.  
  646. // I/O functions
  647.  
  648. void print(...);
  649. int __printSTRING(string: s);
  650. int __printINT(int: i);
  651. int __printLONG(long: l);
  652. int __printCHAR(char: c);
  653. int __printUNSIGNED_INT(int: i);
  654. int __printUNSIGNED_LONG(long: l);
  655. int __printUNSIGNED_CHAR(char: c);
  656.  
  657. int ansi_detect();
  658. int rip_detect();
  659.  
  660. // Local keyboard state
  661.  
  662. int keyboard(int: state);
  663. int iskeyboard();
  664. int snoop(int: state);
  665. int issnoop();
  666.  
  667. // RIP helper functions
  668.  
  669. void set_textsize(int: cols, int: rows);
  670. int rip_send(string: filename, int: display);
  671. int rip_hasfile(string: filename, ref long: filesize);
  672.  
  673. // Area search related
  674.  
  675. #define AFFO_NODIV  0
  676. #define AFFO_DIV    1
  677.  
  678. int fileareafindfirst(ref struct _farea: fa, string: name, int: flags);
  679. int fileareafindnext(ref struct _farea: fa);
  680. void fileareafindclose();
  681. int fileareaselect(string: name);
  682.  
  683. void file_area();
  684.  
  685. int msgareafindfirst(ref struct _marea: ma, string: name, int: flags);
  686. int msgareafindnext(ref struct _marea: ma);
  687. void msgareafindclose();
  688. int msgareaselect(string: name);
  689.  
  690. void msg_area();
  691.  
  692. // Filesystem related
  693.  
  694. int rename(string: oldname, string: newname);
  695. int remove(string: filename);
  696. int filecopy(string: fromname, string: toname);
  697. int fileexists(string: filename);
  698. long filesize(string: filename);
  699. int filedate(string: filename, ref struct _stamp: filedate);
  700.  
  701. int filefindfirst(ref struct _ffind: ff, string: filename, int: attribs);
  702. int filefindnext(ref struct _ffind: ff);
  703. void filefindclose(ref struct _ffind: ff);
  704.  
  705. // Caller file
  706.  
  707. int call_open();
  708. void call_close();
  709. long call_numrecs();
  710. int call_read(long: recno, ref struct _callinfo: ci);
  711.  
  712. // User file
  713.  
  714. int userfindopen(string: name, string: alias, ref struct _usr: u);
  715. int userfindnext(ref struct _usr: u);
  716. int userfindprev(ref struct _usr: u);
  717. void userfindclose();
  718.  
  719. long userfilesize();
  720. int userupdate(ref struct _usr: u, string: origname, string: origalias);
  721. int usercreate(ref struct _usr: u);
  722. int userremove(ref struct _usr: u);
  723. int userfindseek(long: rec, ref struct _usr: u);
  724.  
  725. // Special & modem support
  726.  
  727. int time_check(int: state);
  728. void chatstart();
  729. int dcd_check(int: state);
  730. int mdm_command(string: cmdstring);
  731. void mdm_flow(int: state);
  732. int carrier();
  733. long xfertime(int: protocol, long: bytes);
  734.  
  735.